/**
 * 
 */
package sort.ui.components;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

/**
 * @author masaru-gotou
 *
 */
@SuppressWarnings("serial")
public class RepeatSelectorPanel extends SelectorPanel {
	private JTextField exec_count;
	public static final int DEFAULT_EXEC_COUNT = 3;
	
	public RepeatSelectorPanel() {
		add(new JLabel("Exec count:"));
		exec_count = new NumberField();
		exec_count.setText(String.valueOf(DEFAULT_EXEC_COUNT));
		exec_count.setColumns(10);
		add(exec_count);
	}
	
	public int getExecCount() {
		return Integer.parseInt(exec_count.getText());
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                //Create and set up the window.
                JFrame frame = new JFrame("Repeat SelectorPanel Test");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                //Create and set up the content pane.
        		RepeatSelectorPanel panel = new RepeatSelectorPanel();
        		panel.setOpaque(true);
        		frame.setContentPane(panel);

                //Display the window.
                frame.pack();
                frame.setVisible(true);
            }
        });
	}

}
